﻿using System;
using System.Collections.Generic;
using System.Text;

namespace YXYLCommon
{
    public class BaseForm:System.Windows.Forms.Form
    {
        public BaseForm()
        {
            //this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            //this.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, (byte)134);
        }
        private void InitializeComponent()
        {
            
        }
        protected override void OnLoad(EventArgs e)
        {
                  
            if (XAIsLogin())
            {
                XALoadRights();
                XBBindDDL();
                XBGetQueryParm();
                XBShowModel();
                XCBindList();
            }
            base.OnLoad(e);
        }
        protected virtual bool XAIsLogin()
        { 
            return true;
        }
        protected virtual void XALoadRights()
        {
            
        }
        protected virtual void XBBindDDL()
        { 
            
        }
        protected virtual void XBGetQueryParm()
        { 
        
        }
        protected virtual void XBShowModel()
        {

        }
        protected virtual void XCBindList()
        { 
            
        }

        /// <summary>
        /// 保存操作-数据完整性验证
        /// </summary>
        protected virtual bool XSaveIntegrateValidate()
        {
            return true;
        }

        /// <summary>
        /// 保存操作-数据逻辑性验证
        /// </summary>
        protected virtual bool XSaveLogicValidate()
        {
            return true;
        }

        /// <summary>
        /// 保存操作-执行保存
        /// </summary>
        protected virtual void XSaveOperate()
        { 
            
        }

        /// <summary>
        /// 执行保存(1.执行完整性验证方法 2.执行逻辑性验证方法 3.执行保存操作)
        /// </summary>
        protected void XSave()
        {
            if (XSaveIntegrateValidate()&&XSaveLogicValidate())
            {
                XSaveOperate();
            }
        }

        protected virtual void XZRefreshList1()
        { 
            
        }
        protected virtual void XZRefreshList2()
        {

        }
    }
}
